package demo2;

/**
 * Version: 1.1
 * Author: TangJun
 * Date: 2024-07-18
 */
public class Person implements Cloneable{
    public int age;
    public Color col = new Color();

    @Override
    public String toString() {
        return "Person{" +
                "age=" + age +
                ", col=" + col +
                '}';
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        Person tmp = (Person)super.clone();
        tmp.col = (Color)this.col.clone();
        return tmp;
    }
}
